<!--
 * @Author: your name
 * @Date: 2021-07-13 09:35:42
 * @LastEditTime: 2021-09-24 10:33:01
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \newvue3\src\views\About.vue
-->
<template>
  <div>
    跳转的Id
    <!-- {{id}} -->
    {{ a }}
    <p @click="home">跳转home</p>
  </div>
</template>

<script>
import router from "@/router/index.js";

import {
  onBeforeMount,
  onMounted,
  onBeforeUpdate,
  onUpdated,
  onBeforeUnmount,
  onUnmounted,
  onActivated,
  onDeactivated,
  onErrorCaptured,
  onRenderTracked,
  onRenderTriggered,
  reactive,
  toRef,
  toRefs,
} from "vue";
export default {
  name: "about",
  setup() {
    onMounted(() => {
      let rou = router.currentRoute.value.params; //接收产出
      console.log(rou);
    });

    const count = reactive({
      a: 10.9,
    });

    let home = () => {
      router.push({
        name: "home",
      });
      console.log("home");
    };

    return {
      home,
      ...toRefs(count),
    };
  },
};
</script>

<style>
</style>